home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue32 / construc / DRBOBCED.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-03-09  |  1.4 KB  |  55 lines

  1. unit DrBobCED;
  2. interface
  3. uses
  4.   DsgnIntf, DBTables, DBWeb;
  5.  
  6. type
  7.   TQueryTableProducerComponentEditor = class(TComponentEditor)
  8.   public
  9.     function GetVerbCount: Integer; override;
  10.     function GetVerb(Index: Integer): String; override;
  11.     procedure ExecuteVerb(Index: Integer); override;
  12.   end;
  13.  
  14.   procedure Register;
  15.  
  16. implementation
  17. uses
  18.   DrBobWiz, Classes, Controls, Forms;
  19.  
  20.   function TQueryTableProducerComponentEditor.GetVerbCount: Integer;
  21.   begin
  22.     Result := 1
  23.   end {GetVerbCount};
  24.  
  25.   function TQueryTableProducerComponentEditor.GetVerb(Index: Integer): String;
  26.   begin
  27.     Result := 'Query-2-HTML CGI-Form Wizard...'
  28.   end {GetVerb};
  29.  
  30.   procedure TQueryTableProducerComponentEditor.ExecuteVerb(Index: Integer);
  31.   begin
  32.     with TFormWizard.Create(Application) do
  33.     try
  34.       with (Component AS TQueryTableProducer) do
  35.       begin
  36.         if Assigned(Query) then
  37.         begin
  38.           ComboBoxAliases.Text := (Query AS TQuery).DatabaseName;
  39.           MemoSQL.Lines.Assign((Query AS TQuery).SQL);
  40.           if Assigned((Query AS TQuery).Params) then
  41.             TheQuery.Params.Assign((Query AS TQuery).Params)
  42.         end
  43.       end;
  44.       if ShowModal = mrOK then Finish
  45.     finally
  46.       Free
  47.     end
  48.   end {Edit};
  49.  
  50.   procedure Register;
  51.   begin
  52.     RegisterComponentEditor(TQueryTableProducer, TQueryTableProducerComponentEditor)
  53.   end;
  54. end.
  55.